@extends('layouts.app', ['active' => 4])
@section('title')查看人员- {{ $person->name }}
@endsection
@section('style')
<link href="{{ asset('plugin/datepicker/css/foundation-datepicker.css') }}" rel="stylesheet" type="text/css">
    <style>

        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
            padding: 8px;
            line-height: 1.6;
            vertical-align: top;
            border-top: 1px solid #ddd;width:30%
        }
    </style>

@endsection

@section('content')

            <div class="panel panel-default">
                <div class="panel-heading"><i class="fa fa-user-o" aria-hidden="true"></i> 查看人员 ID<strong>{{ $person->id }}</strong> <a id="info_print" href="javascript:;" ><i class="fa fa-print" aria-hidden="true"></i>打印</a>
                    @include('person.menu',['active' => 0])
                </div>
                <div class="panel-body" id="person_info">

                    <table class="table table-bordered" style="text-align:left">
                        <tbody>
                        <tr>
                            <th colspan="1">
                                姓名
                            </th>
                            <td colspan="2">
                                {{ $person->name }}
                            </td>
                            <td rowspan="3" colspan="1">
                                <img src="{{ url('/') }}/@if ($person->avatar != ''){{ $person->avatar }}@else{{  'img/avatar_default.png' }}@endif"style="cursor:pointer" width="128" height="" id="avatar_img" class="img-thumbnail"/>
                            </td>
                        </tr>
                        <tr>
                            <th colspan="1">身份证号</th>
                            <td colspan="2">
                                {{ $person->id_number }}
                            </td>
                        </tr>
                        <tr>
                            <th colspan="1">是否本市</th>
                            <td colspan="2">
                                @if ($person->is_the_city == 1)是 @else 否 @endif
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="padding:0">
                                <table style="width:100%;border:none">
                                    <tr>
                                        <th style="width:25%;padding:8px;border-right:1px solid #ccc">户籍地</th>
                                        <td style="width:25%;padding:8px;border-right:1px solid #ccc">
                                            {{ $person->reg_addr }}
                                        </td>
                                        <th  style="width:25%;padding:8px;border-right:1px solid #ccc">暂住地</th>
                                        <td  style="width:25%;padding:8px;">
                                            {{ $person->temp_addr }}
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="4" style="padding:0">
                                <table style="width:100%;border:none">
                                    <tr>
                                        <th  style="width:25%;padding:8px;border-right:1px solid #ccc">
                                            到我市时间
                                        </th>
                                        <td  style="width:25%;padding:8px;border-right:1px solid #ccc">
                                            {{ $person->five_saw_time==0?'已离开':date('Y-m-d', $person->five_saw_time) }}
                                        </td>
                                        <th  style="width:25%;padding:8px;border-right:1px solid #ccc">
                                            离开我市时间
                                        </th>
                                        <td  style="width:25%;padding:8px">
                                            {{ $person->leave_time==0?'尚未离开':date('Y-m-d', $person->leave_time) }}
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="padding:0">
                                <table style="width:100%;border:none">
                                    <tr >
                                        <th style="width:16.66%;padding:8px;border-right:1px solid #ccc">
                                            手机号
                                        </th>
                                        <td style="width:16.66%;padding:8px;border-right:1px solid #ccc">
                                            {{ $person->phone }}
                                        </td>
                                        <th style="width:16.66%;padding:8px;border-right:1px solid #ccc">
                                            QQ
                                        </th>
                                        <td style="width:16.66%;padding:8px;border-right:1px solid #ccc">
                                            {{ $person->qq }}
                                        </td>
                                        <th style="width:16.66%;padding:8px;border-right:1px solid #ccc">
                                            微信
                                        </th>
                                        <td style="width:16.66%;padding:8px;">
                                            {{ $person->weixin }}
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                        </tr>
                        <tr>
                            <th colspan="1">见面情况</th>
                            <td colspan="5">
                                {{ $person->meet_situation }}
                            </td>
                        </tr>
                        <tr>
                            <th colspan="1">我市活动情况</th>
                            <td colspan="5">
                                {{ $person->meet_situation }}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

@endsection

@section('script')

<script src="{{ asset('plugin/print/jQuery.print.js') }}"></script>
<script type='text/javascript'>
    //<![CDATA[
    jQuery(function($) { 'use strict';

        $("#info_print").on('click', function() {
            //Print ele4 with custom options
            $("#person_info").print({
                //Use Global styles
                globalStyles : true,
                //Add link with attrbute media=print
                mediaPrint : true,
                //Custom stylesheet

                //Print in a hidden iframe
                iframe : false,
                //Don't print this
                noPrintSelector : ".avoid-this",
                //Add this at top
                prepend : "",
                //Add this on bottom
                append : "",
                //Log to console when printing is done via a deffered callback
                deferred: $.Deferred().done(function() { console.log('Printing done', arguments); })
            });
        });
        // Fork https://github.com/sathvikp/jQuery.print for the full list of options
    });
    //]]>
</script>


@endsection
